*-------------------------------------------------------------------------------

* Table A.1: Descriptive statistics of student variables

*-------------------------------------------------------------------------------

	
global replica_dir=	"<add path to your working directory>"
global data_dir=	"$replica_dir/data"
global output_dir=	"$replica_dir/output"


use "$data_dir/panel_simce4b6_sned_studlvl.dta", clear

global indepvars "mate_pre lect_pre nat_pre sch_municip_pre rural_rbd sch_stno_pre tipo_est_num_1 tipo_est_num_2 mom_edu_pre dad_edu_pre pad_inc_pre sch_gse_pre "  

*-------------------------------------------------------------------------------


tab    sel, gen(sel_)
la var sel_1 "Selected for 100\% SNED award"
la var sel_2 "Selected for 60\% SNED award"


gen 	sch_gse_pre_3up=(sch_gse_pre>=3)
la var 	sch_gse_pre_3up "School socio-economic status above mid-range"


la var mate_post "Grade 6 Mathematics score"
la var lect_post "Grade 6 Reading score"

la var mate_pre 	"Grade 4 Mathematics Score"
la var lect_pre 	"Grade 4 Reading Score"

la var sch_stno_pre 	"School enrollment"
la var sch_municip_pre 	"Municipal school"
la var rural_rbd 		"School rural location"

la var mom_edu_pre 		"Education years, mother"
la var dad_edu_pre 		"Education years, father"
la var pad_inc_pre 		"Parental income, intervals"

la var tipo_est_num_1 "School type, primary, grades 1-8"
la var tipo_est_num_2 "School type, primary and secondary, grades 1-12"


*-------------------------------------------------------------------------------

  
estpost su  sel_1 sel_2 ///
			mate_post lect_post   ///
			mate_pre  lect_pre   ///
			mom_edu_pre dad_edu_pre pad_inc_pre  ///
			rural_rbd sch_municip_pre sch_stno_pre sch_gse_pre_3up tipo_est_num_1 tipo_est_num_2
 

est store C 

esttab  C    using "$output_dir/sumstats_6b4.tex", replace ///
		mtitle( "SNED 2012-13 to 2014-15 & Mean & Standard deviation") ///
		cells("mean(fmt(3)) sd(fmt(3)par)") booktabs  nonum collabels(none) f label 

 
 
